import { createRouter, createWebHashHistory } from 'vue-router'


const routes = [
  {
    path: '/',
    name: '登录',
    component: () => import('../views/login'),

  },
  {
    path: '/home',
    name: '首页',
    component: () => import('../views/layout'),
    redirect: '/home',
    children: [
      {
      path: '/home',
      name: '首页',
      component: () => import('../views/home/index'),
    },
    {
      path: '/user',
      name: '用户管理',
      component: () => import('../views/user/index'),
    },
    {
      path: '/fruitType',
      name: '商品大类',
      component: () => import('../views/fruitType/index'),
    },
    {
      path: '/classify',
      name: '商品小类',
      component: () => import('../views/classify/index'),
    },
    {
      path: '/product',
      name: '商品管理',
      component: () => import('../views/product/index'),
    },
    {
      path: '/order',
      name: '订单管理',
      component: () => import('../views/order/index'),
    },
    {
      path: '/orderEvaluations',
      name: '评价管理',
      component: () => import('../views/orderEvaluations/index'),
    },
    {
      path: '/address',
      name: '地址管理',
      component: () => import('../views/address/index'),
    },
    {
      path: '/productHistory',
      name: '历史浏览记录管理',
      component: () => import('../views/productHistory/index'),
    },
    {
      path: '/feedback',
      name: '用户意见反馈管理',
      component: () => import('../views/feedback/index'),
    },
    {
      path: '/modifyPassword',
      name: '修改密码',
      component: () => import('../views/modifyPassword/index'),
    }
  ]
  },

  {
    path: '/layout',
    name: 'layout',
    component: () => import('../views/layout')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
